use std::fmt::format;
use crate::HtmlElements;
pub struct Builder{ 
    html:String,
    children:Vec<Box<dyn HtmlElements::base::ToHtml>>
}
impl Builder{
    pub fn new() ->Builder{
        Builder{
            html:String::new(),
            children:Vec::new()
        }
    }
    pub fn add_child(mut self,child:Box<dyn HtmlElements::base::ToHtml>) ->Self{
        self.children.push(child);
        self
    }
    pub fn build(mut self) ->String{
        self.html.push_str(&"<html>");
        for data in &self.children{
            self.html.push_str(&data.to_html());
        }
        self.html.push_str(&"</html>");
        self.html
    }
}